<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
          "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>QUnit for X509.getInfo() test in 'x509.js' </title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="qunit.js"></script>
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen" />

<script src="../ext/cj/cryptojs-312-core-fix.js"></script>
<script src="../ext/cj/x64-core.js"></script>
<script src="../ext/cj/cipher-core_min.js"></script>
<script src="../ext/cj/aes_min.js"></script>
<script src="../ext/cj/tripledes_min.js"></script>
<script src="../ext/cj/enc-base64_min.js"></script>
<script src="../ext/cj/md5_min.js"></script>
<script src="../ext/cj/sha1_min.js"></script>
<script src="../ext/cj/sha256_min.js"></script>
<script src="../ext/cj/sha224_min.js"></script>
<script src="../ext/cj/sha512_min.js"></script>
<script src="../ext/cj/sha384_min.js"></script>
<script src="../ext/cj/ripemd160_min.js"></script>
<script src="../ext/cj/hmac_min.js"></script>
<script src="../ext/cj/pbkdf2_min.js"></script>


<script src="../ext/jsbn.js"></script>
<script src="../ext/jsbn2.js"></script>
<script src="../ext/prng4.js"></script>
<script src="../ext/rng.js"></script>
<script src="../ext/rsa.js"></script>
<script src="../ext/rsa2.js"></script>
<script src="../ext/base64.js"></script>

<script src="../src/base64x-1.1.js"></script>
<script src="../src/crypto-1.1.js"></script>
<script src="../src/asn1hex-1.1.js"></script>
<script src="../src/rsapem-1.1.js"></script>
<script src="../src/rsasign-1.2.js"></script>
<script src="../src/x509-1.1.js"></script>
<script src="../src/asn1-1.0.js"></script>
<script src="../src/asn1x509-1.0.js"></script>
<script src="../src/keyutil-1.0.js"></script>

<script type="text/javascript">
$(document).ready(function(){

// _test/0cert/github.com.cer
var certGithubPEM = (function() {/*
-----BEGIN CERTIFICATE-----
MIIF4DCCBMigAwIBAgIQDACTENIG2+M3VTWAEY3chzANBgkqhki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ERTIFICATE-----
*/}).toString().match(/\/\*([^]*)\*\//)[1];

// _test/0cert_sites/danmarksapotuser1.cer
var danmarksUser1PEM = (function() {/*
-----BEGIN CERTIFICATE-----
MIIGYDCCBUigAwIBAgIEU7s4dDANBgkqhkiG9w0BAQsFADBAMQswCQYDVQQGEwJE
SzESMBAGA1UECgwJVFJVU1QyNDA4MR0wGwYDVQQDDBRUUlVTVDI0MDggT0NFUyBD
QSBJSTAeFw0xNTEyMzAxMjE4MDNaFw0xODEyMzAxMjE2NTBaMIGeMQswCQYDVQQG
EwJESzEyMDAGA1UECgwpRGFubWFya3MgQXBvdGVrZXJmb3JlbmluZyAvLyBDVlI6
MjAxMjQ1MTIxWzAgBgNVBAUTGUNWUjoyMDEyNDUxMi1VSUQ6NjQyOTA2OTgwNwYD
VQQDDDBEYW5tYXJrcyBBcG90ZWtlcmZvcmVuaW5nIC0gRGFubWFya3MgQXBvdGVr
ZXJmb3IwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQNL1iA9kO241w
eNpuTm/OoU5i9kOpp+/Vi6OmY14aYEIpgDEWr6nfeGugrsFyR2crOxr7iRhngUyk
UnSsfSqPkhhGiXdcPtEplSubCzP08zf/0PyIyyV5LoBEZr60M7LmahPuQojb09sK
dCTEDMk46LCeISEQGI/ZggALH1SRSQiodctQvVN98okuaJDobgbTi/P2sMu3OK/J
SbQrI2kn5d4ShUlWIBkZqsRUBNRmrvfBQzZpv2+mkDMFGouYzSkYccPivzQCx8BV
9e2QdrB6KVnT6m/l5ND0d3qY41h0i/CffnjofQmoaQ1a3xO82+A6EF+Dl3QF5Wcm
fR2Z2C6rAgMBAAGjggMBMIIC/TAOBgNVHQ8BAf8EBAMCA7gwgYkGCCsGAQUFBwEB
BH0wezA1BggrBgEFBQcwAYYpaHR0cDovL29jc3AuaWNhMDIudHJ1c3QyNDA4LmNv
bS9yZXNwb25kZXIwQgYIKwYBBQUHMAKGNmh0dHA6Ly92LmFpYS5pY2EwMi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VdjXybOrIihRg8zRKZ4Utm1NV2Rfoh4C9D50uIMgcaIJ2W
rhD4uIUbomqy9Ex0qUmTAV6eZh5ynCjlVYie3UqeJ+UoVfpsNMFNRJdoeKsn6g1W
U2rgoKzYAzliiC89n3hrNbm7rcBLgDFfWsHUtO1w2PDfRAqJcHWoTQiIQNUCPTa8
B9LZ8g==
*/}).toString().match(/\/\*([^]*)\*\//)[1];

// _test/???
var san1PEM = (function() {/*
-----BEGIN CERTIFICATE-----
MIICCjCCAXOgAwIBAgIBATANBgkqhkiG9w0BAQsFADAeMQswCQYDVQQGEwJKUDEP
MA0GA1UECgwGVGVzdENBMB4XDTIyMTAyODE0MDAwM1oXDTIzMTAyODE0MDAwM1ow
EDEOMAwGA1UEAwwFYS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALDi
kFExZMEW5bwsj9DckEA+Ai7jYe7+In5UHpsqCaqXlPlJQFpziDWDHp1IlWI6r+nZ
/7AJhS3y6wbVrF8IN4ohKaga1LIL3RDfnGbm4QcF06rrE0vHkMALUu0o/7zmR0qU
geNnRhd21J/+5vt9nzbaigklghW3DKYCaZN/n3CbAgMBAAGjZjBkMGIGA1UdEQRb
MFmkHDAaMQswCQYDVQQGEwJKUDELMAkGA1UECgwCTzGHBMCoAQWBB2FAYS5jb22G
DGh0dHA6Ly9hLmNvbYIFYS5jb22gFQYIKwYBBQUHCAmgCQwHYUBhLmNvbTANBgkq
hkiG9w0BAQsFAAOBgQATHBsnLqNsnH+3xH+tj8u1HXrQb3Z3AmPQ/W++kvlOMi1i
o/WbHGa3lrJCYomw7O1U36HkCedSCPbv2zoof0MYVLa4XyWt8DuL9GT/WTO9vHzv
Y0OgvwaSbp0daCfOHdXDGb8E2qJXutdNgAvXl/gprZ6dM0c8d0kLUs+hTuAHpw==
-----END CERTIFICATE-----
*/}).toString().match(/\/\*([^]*)\*\//)[1];

// _test/0cert/digicertevroot.cer
var certDigicertOUT = (function() {/*Basic Fields
  serial number: 02ac5c266a0b409b8f0b79f2ae462577
  signature algorithm: SHA1withRSA
  issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
  notBefore: 061110000000Z
  notAfter: 311110000000Z
  subject: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
  subject public key info: 
    key algorithm: RSA
    n=00c6cce573e6fbd4...
    e=010001
X509v3 Extensions:
  keyUsage CRITICAL:
    digitalSignature,keyCertSign,cRLSign
  basicConstraints CRITICAL:
    cA=true
  subjectKeyIdentifier :
    b13ec36903f8bf4701d498261a0802ef63642bc3
  authorityKeyIdentifier :
    kid=b13ec36903f8bf4701d498261a0802ef63642bc3
signature algorithm: SHA1withRSA
signature: 1c1a0697dcd79c9f...
*/}).toString().match(/\/\*([^]*)\*\//)[1];

// _test/0cert/pulse.cio.gov.cer
var certCioGovOUT = (function() {/*Basic Fields
  serial number: 03e03a5d78e2a8e129eb0b3144f48c8a1b3d
  signature algorithm: SHA256withRSA
  issuer: /C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
  notBefore: 160403023700Z
  notAfter: 160702023700Z
  subject: /CN=pulse.cio.gov
  subject public key info: 
    key algorithm: RSA
    n=00cabe2d702f0a18...
    e=010001
X509v3 Extensions:
  keyUsage CRITICAL:
    digitalSignature,keyEncipherment
  extKeyUsage :
    serverAuth, clientAuth
  basicConstraints CRITICAL:
    {}
  subjectKeyIdentifier :
    f2eba920f40ce881494b5040e8db05286074a806
  authorityKeyIdentifier :
    kid=a84a6a63047dddbae6d139b7a64565eff3a8eca1
  authorityInfoAccess :
    ocsp: http://ocsp.int-x3.letsencrypt.org/
    caissuer: http://cert.int-x3.letsencrypt.org/
  subjectAltName :
    dns: https.cio.gov
    dns: pulse.cio.gov
    dns: staging.pulse.cio.gov
  certificatePolicies :
    policy oid: 2.23.140.1.2.1
    policy oid: 1.3.6.1.4.1.44947.1.1.1
    cps: http://cps.letsencrypt.org
signature algorithm: SHA256withRSA
signature: 0b76f2c64e9cf6fd...
*/}).toString().match(/\/\*([^]*)\*\//)[1];

// _test/0cert/github.com.cer
var certGithubOUT = (function() {/*Basic Fields
  serial number: 0c009310d206dbe337553580118ddc87
  signature algorithm: SHA256withRSA
  issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA
  notBefore: 140408000000Z
  notAfter: 160412120000Z
  subject: /businessCategory=Private Organization/jurisdictionOfIncorporationC=US/jurisdictionOfIncorporationSP=Delaware/serialNumber=5157550/STREET=548 4th Street/postalCode=94107/C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=github.com
  subject public key info: 
    key algorithm: RSA
    n=00b1d4dc3caffdf3...
    e=010001
X509v3 Extensions:
  authorityKeyIdentifier :
    kid=3dd350a5d6a0adeef34a600a65d321d4f8f8d60f
  subjectKeyIdentifier :
    6a43907d3b98147252953aaa280a43f8517ed3a6
  subjectAltName :
    dns: github.com
    dns: www.github.com
  keyUsage CRITICAL:
    digitalSignature,keyEncipherment
  extKeyUsage :
    serverAuth, clientAuth
  cRLDistributionPoints :
    http://crl3.digicert.com/sha2-ev-server-g1.crl
    http://crl4.digicert.com/sha2-ev-server-g1.crl
  certificatePolicies :
    policy oid: 2.16.840.1.114412.2.1
    cps: https://www.digicert.com/CPS
  authorityInfoAccess :
    ocsp: http://ocsp.digicert.com
    caissuer: http://cacerts.digicert.com/DigiCertSHA2ExtendedValidationServerCA.crt
  basicConstraints CRITICAL:
    {}
signature algorithm: SHA256withRSA
signature: 6fe76dcb82f3ef90...
*/}).toString().match(/\/\*([^]*)\*\//)[1];

// _test/0cert/github.com.cer
var danmarksUser1OUT = (function() {/*Basic Fields
  serial number: 53bb3874
  signature algorithm: SHA256withRSA
  issuer: /C=DK/O=TRUST2408/CN=TRUST2408 OCES CA II
  notBefore: 151230121803Z
  notAfter: 181230121650Z
  subject: /C=DK/O=Danmarks Apotekerforening \// CVR:20124512/serialNumber=CVR:20124512-UID:64290698+CN=Danmarks Apotekerforening - Danmarks Apotekerfor
  subject public key info: 
    key algorithm: RSA
    n=00d034bd6203d90e...
    e=010001
X509v3 Extensions:
  keyUsage CRITICAL:
    digitalSignature,keyEncipherment,dataEncipherment,keyAgreement
  authorityInfoAccess :
    ocsp: http://ocsp.ica02.trust2408.com/responder
    caissuer: http://v.aia.ica02.trust2408.com/oces-issuing02-ca.cer
  certificatePolicies :
    policy oid: 1.2.208.169.1.1.1.3.4
    cps: http://www.trust2408.com/repository
  subjectAltName :
    rfc822: apotekerforeningen@apotekerforeningen.dk
  cRLDistributionPoints :
    http://crl.ica02.trust2408.com/ica02.crl
  authorityKeyIdentifier :
    kid=998fba0d89ae211a427a0aae1a4c4e22ff10eb8c
  subjectKeyIdentifier :
    73f5be2db40c5c04e86fcd2ac6754d1390de0da8
  basicConstraints :
    {}
signature algorithm: SHA256withRSA
signature: 5a0323b8bc53d46b...
*/}).toString().match(/\/\*([^]*)\*\//)[1];

// _test/???
var san1OUT = (function() {/*Basic Fields
  serial number: 01
  signature algorithm: SHA256withRSA
  issuer: /C=JP/O=TestCA
  notBefore: 221028140003Z
  notAfter: 231028140003Z
  subject: /CN=a.com
  subject public key info: 
    key algorithm: RSA
    n=00b0e290513164c1...
    e=010001
X509v3 Extensions:
  subjectAltName :
    dn: /C=JP/O=O1
    ip: 192.168.1.5
    rfc822: a@a.com
    uri: http://a.com
    dns: a.com
    other: smtpUTF8Mailbox={utf8str:{str:a@a.com}}
signature algorithm: SHA256withRSA
signature: 131c1b272ea36c9c...
*/}).toString().match(/\/\*([^]*)\*\//)[1];

// test cert for PolicyMappings/PolicyConstraints/InhibitAnyPolicy
var certpolicy1 = (function() {/*
-----BEGIN CERTIFICATE-----
MIIBXzCCAQmgAwIBAgIBBTANBgkqhkiG9w0BAQsFADAZMQswCQYDVQQGEwJVUzEK
MAgGA1UECgwBYTAeFw0xMzA1MDQyMzU5NTlaFw0xNDA1MDQyMzU5NTlaMBkxCzAJ
BgNVBAYTAlVTMQowCAYDVQQKDAFiMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAOhm
TdK0BSkSFWjzs5vJemLnujwJur3E8NzY35DreQubtkWitw4xEnR7TTxBtRQkiVEV
/viPedQ+rlsaTjUY/VkCAwEAAaM8MDowGAYDVR0hAQH/BA4wDDAKBgRVHSAABgIq
AzAPBgNVHSQBAf8EBTADgAEBMA0GA1UdNgEB/wQDAgEBMA0GCSqGSIb3DQEBCwUA
A0EAGwTGkeupwtmSq8EaulvG/Hwhv/gXtBNaX0SK/1r8YIrEYXx5znfLTchD39ka
SawVIARW+0ZiDLfbAZHUM60cVQ==
-----END CERTIFICATE-----
*/}).toString().match(/\/\*([^]*)\*\//)[1];

var certpolicy1OUT = (function() {/*Basic Fields
  serial number: 05
  signature algorithm: SHA256withRSA
  issuer: /C=US/O=a
  notBefore: 130504235959Z
  notAfter: 140504235959Z
  subject: /C=US/O=b
  subject public key info: 
    key algorithm: RSA
    n=00e8664dd2b40529...
    e=010001
X509v3 Extensions:
  policyMappings CRITICAL:
    anyPolicy:1.2.3
  policyConstraints CRITICAL:
     reqexp=1
  inhibitAnyPolicy CRITICAL:
    skip=1
signature algorithm: SHA256withRSA
signature: 1b04c691eba9c2d9...
*/}).toString().match(/\/\*([^]*)\*\//)[1];

// == END OF TEST DATA ============================================

test("X509.getInfo() DigiCert EV Root", function() {
var c = new X509(certDigicertPEM);
equal(c.getInfo(), certDigicertOUT, certDigicertOUT);
});

test("X509.getInfo() pulse.cio.gov SSL cert", function() {
var c = new X509(certCioGovPEM);
equal(c.getInfo(), certCioGovOUT, certCioGovOUT);
});

test("X509.getInfo() github.com SSL cert", function() {
var c = new X509(certGithubPEM);
equal(c.getInfo(), certGithubOUT, certGithubOUT);
});

test("X509.getInfo() danmarks user cert", function() {
var x = new X509(danmarksUser1PEM);
//deepEqual(x.getExtCertificatePolicies(),{},"cp");
//deepEqual(x.getExtCRLDistributionPoints(),{},"cdp");
equal(x.getInfo(), danmarksUser1OUT, danmarksUser1OUT);
});

test("X509.getInfo() various SAN", function() {
var x = new X509(san1PEM);
equal(x.getInfo(), san1OUT, san1OUT);
});

test("getInfo() for policy related extensions", function() {
var x = new X509(certpolicy1);
equal(x.getInfo(), certpolicy1OUT, "for certificate policy related extensions");
});

});
</script>
  
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture">test markup</div>

<p>
<a href="../">TOP</a> | 
<a href="index.html">TEST INDEX</a> | 
<a href="qunit-do-x509.html">x509</a> | 
<a href="qunit-do-x509-ext.html">x509-ext</a> | 
<a href="qunit-do-x509-key.html">x509-key</a> | 
<a href="qunit-do-x509-kid.html">x509-kid</a> | 
<a href="qunit-do-x509-getinfo.html">x509-getinfo</a> | 
<a href="qunit-do-x509-v1.html">x509-v1</a> | 
</p>

</body>
<center><p>&copy; 2016-2022 Kenji Urushima</p></center>
</html>
